<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		#img{
			display: none;
		}

	</style>
</head>
<body>
	<input type="button" value="显示" id="btn">
	<input type="button" value="点击按钮显示图片" id="btn1">
	<img src="../image/1-small.jpg" alt="" id="img">

	<img src="" alt="" id="img2" width="200" height="200">

	<script>
		var img = document.getElementById('img');
		var btn = document.getElementById('btn');
		var btn1 = document.getElementById('btn1');
		var img2 = document.getElementById("img2");

		btn.onclick = function(){
			if(btn.value == "显示"){
				btn.value = "隐藏"
				img.style = "display:block"
			}else{
				btn.value = "显示"
				img.style = "display:none"
			}
			
		}

		btn1.onclick = function(){
			img2.src = "../image/2-small.jpg";
			img2.width = "400";
			img2.height = "400"
		}

	</script>
</body>
</html>